package org.ccams.domain;

import java.io.Serializable;

import net.sf.json.JSONObject;

public class JSONTree implements Serializable{
 
     private static final long serialVersionUID = 1L;    
     private String id;            //ID
     private String text;          //节点显示     
     private boolean leaf;         //是否叶子
     private boolean allowDrag;    //是否可拖拽
     private String description;   //描述信息
	public String getId() {
		return id;
	}
	public boolean isAllowDrag() {
		return allowDrag;
	}
	public void setAllowDrag(boolean allowDrag) {
		this.allowDrag = allowDrag;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public boolean isLeaf() {
		return leaf;
	}
	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	public JSONObject toJSONObject() throws Exception {
		JSONObject json = new JSONObject();
		json.put("id", this.id);
		json.put("text", this.text);		
		json.put("leaf", this.leaf);
		json.put("allowDrag", this.allowDrag);
		json.put("description", this.description);
		return json;
	}


}

